#ifndef _ascendancy_new_game_wizard_
#define _ascendancy_new_game_wizard_

#include <QWizard>
#include <QtOpenGL>
#include <iostream>
#include <QSlider>
#include <stdlib.h>

#include "galaxy_preview.h"
#include "races.h"
#include "game_params.h"

#define NGWIZARD_IMG_EXPLOSIVE	"../img/new_game_wizard/ambience_explosive.png"
#define NGWIZARD_IMG_NEUTRAL	"../img/new_game_wizard/ambience_neutral.png"
#define NGWIZARD_IMG_PEACEFULL	"../img/new_game_wizard/ambience_peacefull.png"

class		NewGameWizard;

class		NewGameWizardPGalaxy : public QWizardPage
{
  Q_OBJECT

public:

  NewGameWizardPGalaxy(QWidget *parent = 0);
  ~NewGameWizardPGalaxy();
  
  void		setGameParams(GameParams *gameParams);
  bool		validatePage();

public slots:
  
  void		changeNbStar(int newNb);

private:

  QWidget	*parent;
  GalaxyPreview	*galaxyPreview;
  QSlider	*nbStarSlider;
  QTimer	*timer;
  int		nbStars;
  GameParams	*gameParams;

  QLabel	*labelText;
  QLabel	*labelNbStars;
};

class		NewGameWizardPRace : public QWizardPage
{
  Q_OBJECT

  public:

  NewGameWizardPRace(QWidget *parent = 0);
  bool		isComplete();
  void		setGameParams(GameParams *gameParams);
  bool		validatePage();

public slots:

  void		setPlayerRace();
  void		nextRace();
  void		previousRace();
  void		addEnemy();
  void		removeLastEnemy();

signals:

  void		allowNextPage();
  void		endOfWizard();

private:

  QWidget	*parent;

  QLabel	*player;
  QLabel	*playerPic;

  std::vector<QLabel*> enemyName;
  std::vector<QLabel*> enemyPic;
  std::vector<int> enemyId;

  QPushButton	*delLastEnnemy;

  QLabel	*currentRacePicture;
  QLabel	*currentRaceData;
  QLabel	*currentRaceName;

  int		currentRace;
  int		playerRace;
  // std::vector<int> enemiList;

  GameParams	*gameParams;

  void		redrawRaceDesc();

};

class		NewGameWizardPAmbience : public QWizardPage
{
  Q_OBJECT

  public:

  NewGameWizardPAmbience(QWidget *parent = 0);

  bool		validatePage();
  void		setGameParams(GameParams *gameParams);
  
signals:

  void		ambienceEnd();

private:

  QWidget	*parent;
  GameParams	*gameParams;

};


class		NewGameWizard : public QWizard
{
  Q_OBJECT

  public:

  NewGameWizard(QWidget *parent = 0);
  ~NewGameWizard();

  void		setGameParams(GameParams *gameParams);
 
public slots:

  void		wizardEnd();

signals:

  void		makeNewGameSig();

private:

  GameParams	*gameParams;

  QWidget	*parent;

  NewGameWizardPGalaxy galaxyPage;
  NewGameWizardPRace racePage;
  NewGameWizardPAmbience ambiencePage;

};

#endif
